package week15;

import java.sql.SQLOutput;
public class CreateThread {
    public static void main(String[] args) {
        Thread A = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("打开冰箱");
            }
        });
        Thread B = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    A.join();
                    System.out.println("把大象装进去");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread C = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    B.join();
                    System.out.println("关掉冰箱");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
A.start();
B.start();
C.start();
    }
}
